<template>
  <div class="publicpageview">
    <div :class="!isSearch ? 'publicformview-new' : 'publicformview-new-gaoji'">
      <el-form :inline="true" :model="listQuery" size="mini" ref="searchForm" label-width="170px">
        <div :class="!isSearch ? 'publicformview-new-left' : 'publicformview-new-left-gaoji'">

          <el-form-item label="区房屋管理单位：" prop="dname" label-width="140px">
            <el-select :disabled='isluru' clearable v-model="listQuery.dname" @change='areaChange'>
              <div v-for="(item,index) in areaList" :key="index">
                <el-option :label="item.dname" :value="item.did" :key="index"></el-option>
              </div>
            </el-select>
          </el-form-item>
          <el-form-item label="管理部(分中心)：" prop="manageDepartment" label-width="140px">
            <el-select :disabled='isluru' clearable v-model="listQuery.manageDepartment" @change='HouseChange' value-key="aname">
              <div v-for="(item,index) in HouseList" :key="index">

                <el-option :label="item.aname" :value="item" :key="index"></el-option>
              </div>
            </el-select>
          </el-form-item>
          <el-form-item label="可售：" prop="isSell" label-width="140px">
            <el-select clearable v-model="listQuery.isSell">
              <el-option label="可售" value="1" key="1"></el-option>
              <el-option label="不可售" value="0" key="0"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="产权单位：" prop="CQDW" label-width="140px">
            <el-select clearable v-model="listQuery.CQDW">
              <el-option label="天津市人民政府" value="天津市人民政府" key="1"></el-option>
              <el-option label="天津市房产管理服务中心" value="天津市房产管理服务中心" key="2"></el-option>
              <el-option label="天津市房置业非融资担保股份有限公司" value="天津市房置业非融资担保股份有限公司" key="3"></el-option>
              <el-option label="外产" value="外产" key="4"></el-option>
              <el-option label="代管产" value="代管产" key="5"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="管片：" prop="group" label-width="140px">
            <el-select clearable v-model="listQuery.group">
              <div v-for="(item,index) in guanpianList" :key="index">
                <el-option :label="item.groupnew" :value="item.groupnew" :key="index"></el-option>
              </div>
            </el-select>
          </el-form-item>
          <el-form-item label="管理形式：" prop="manageway" label-width="140px">
            <el-input v-model="listQuery.manageway"></el-input>
          </el-form-item>
          <el-form-item label="产别：" prop="OwnWay" label-width="140px">
            <el-select clearable v-model="listQuery.OwnWay">
              <el-option label="代管产" value="代管产" key="1"></el-option>
              <el-option label="教会产" value="教会产" key="2"></el-option>
              <el-option label="直管公产" value="直管公产" key="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="性质：" prop="LivingWay" label-width="140px">
            <el-select clearable v-model="listQuery.LivingWay">
              <el-option label="住宅" value="住宅" key="1"></el-option>
              <el-option label="非住宅" value="非住宅" key="0"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="房屋结构：" prop="Structure" label-width="140px">
            <el-select clearable v-model="listQuery.Structure">
              <el-option label="钢混结构" value="钢混结构" key="1"></el-option>
              <el-option label="砖混结构" value="砖混结构" key="2"></el-option>
              <el-option label="砖木结构" value="砖木结构" key="3"></el-option>
              <el-option label="简易结构" value="简易结构" key="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="混所：" prop="RooLivingMixmID" label-width="140px">
            <el-select clearable v-model="listQuery.RooLivingMixmID">
              <el-option label="是" value="1" key="1"></el-option>
              <el-option label="否" value="0" key="0"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="类型：" prop="integer" label-width="140px">
            <el-select clearable v-model="listQuery.integer">
              <el-option label="主体" value="0" key="0"></el-option>
              <el-option label="附属" value="1" key="1"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="建筑形式：" prop="BuildingForm" label-width="140px">
            <el-select clearable v-model="listQuery.BuildingForm">
              <el-option label="楼房" value="楼房" key="1"></el-option>
              <el-option label="平房" value="平房" key="0"></el-option>
            </el-select>
          </el-form-item>
          <!-- <el-col :span="5">
							<el-form-item label="建档：" prop="status">
								<el-select v-model="listQuery.status">
									<el-option label="发布" value="1" key="1"></el-option>
									<el-option label="不发布" value="0" key="0"></el-option>
								</el-select>
							</el-form-item>
						</el-col> -->
          <el-form-item label="地级(住)：" prop="AddressLevelLiving" label-width="140px">
            <el-select clearable v-model="listQuery.AddressLevelLiving">
              <el-option label="一级" value="一级" key="1"></el-option>
              <el-option label="二级" value="二级" key="2"></el-option>
              <el-option label="三级" value="三级" key="3"></el-option>
              <el-option label="四级" value="四级" key="4"></el-option>
              <el-option label="五级" value="五级" key="5"></el-option>
              <el-option label="*" value="*" key="6"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="地级(非)：" prop="AddressLevelNonLiving" label-width="140px">
            <el-select clearable v-model="listQuery.AddressLevelNonLiving">
              <el-option label="甲级" value="甲级" key="1"></el-option>
              <el-option label="乙级" value="乙级" key="2"></el-option>
              <el-option label="丙级" value="丙级" key="3"></el-option>
              <el-option label="丁级" value="丁级" key="4"></el-option>
              <el-option label="茂级" value="茂级" key="5"></el-option>
              <el-option label="特级" value="特级" key="6"></el-option>
              <el-option label="*" value="*" key="7"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="地址：" prop="RAddressoomID" label-width="140px">
            <el-input v-model="listQuery.RAddressoomID"></el-input>
          </el-form-item>
          <el-form-item label="典型建筑：" prop="Modelbuilding" label-width="140px">
            <el-select clearable v-model="listQuery.Modelbuilding">
              <el-option label="文物保护" value="文物保护" key="1"></el-option>
              <el-option label="名人故居" value="名人故居" key="0"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="终止项：" prop="endPro" label-width="140px">
            <el-select clearable v-model="listQuery.endPro">
              <el-option label="未终止" value="1" key="1"></el-option>
              <el-option label="已终止" value="2" key="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="变动原因：" prop="changecause" label-width="140px">
            <el-select clearable v-model="listQuery.changecause">
              <el-option label="拆除待注销(未交补偿费)" value="拆除待注销(未交补偿费)" key="1"></el-option>
              <el-option label="拆除待注销(市政基础设施要件不齐)" value="拆除待注销(市政基础设施要件不齐)" key="2"></el-option>
              <el-option label="拆除待注销(其他)" value="拆除待注销(其他)" key="3"></el-option>
              <el-option label="拆迁冻结" value="拆迁冻结" key="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="变动日期：" prop="changedate" label-width="140px">
            <el-date-picker style="width: 130px;" v-model="listQuery.changedate" type="datetime" placeholder="年/月/日">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="建造年份：" prop="BuildYear" label-width="140px">
            <el-input type="number" v-model="listQuery.BuildYear"></el-input>
          </el-form-item>
          <!-- <el-col :span="5">
							<el-form-item label="管理启始日期：" prop="mobile">
								<el-date-picker v-model="listQuery.time" type="date" placeholder="年/月/日">
								</el-date-picker>
							</el-form-item>
						</el-col> -->
          <el-form-item label="启始日期：" prop="StartDate" label-width="140px">
            <el-date-picker style="width: 130px;" v-model="listQuery.StartDate" type="date" placeholder="年/月/日">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="房屋坐落区：" prop="District" label-width="140px">
            <el-input v-model="listQuery.District"></el-input>
          </el-form-item>
          <!-- 	<el-col :span="5">
						<el-form-item label="不包括拆除注销：" prop="keyword">
							<el-switch v-model="value1">
							</el-switch>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="房屋健康情况预警提示：" prop="keyword">
							<el-switch v-model="value1">
							</el-switch>
						</el-form-item>
					</el-col>
					<el-col :span="5"
						<el-form-item label="自来水移交自来水公司：" prop="keyword">
							<el-switch v-model="value1">
							</el-switch>
						</el-form-item>
					</el-col> -->
        </div>

      </el-form>
      <div :class="!isSearch ? 'publicformview-new-right' : 'publicformview-new-right-gaoji'">
        <el-button size="mini" type="primary" @click="sumbitCx">查询</el-button>
        <el-button size="mini" @click="resetForm('searchForm')">重置</el-button>
        <el-button size="mini" type="primary" @click="isSearch = !isSearch">{{!isSearch?'高级搜索':'关闭搜索'}}</el-button>
      </div>
    </div>

    <div class="publitableview">
      <div class="headContent">
				<el-button type="primary" size="mini" @click="handleUpdate">导出</el-button>
				<div class="allNum">
					<div class="allList" style="line-height: 40px;">合计：</div>
					<div class="allList">总所数： <div>{{blockNum}}</div></div>
					<div class="allList">建筑面积(住)： <div>{{buildingAreaTotal}}</div></div>
					<div class="allList">使用面积(住)： <div>{{usingAreaTotal}}</div></div>
					<div class="allList">建筑面积(非)： <div>{{nonBuildingAreaTotal}}</div></div>
					<div class="allList">使用面积(非)： <div>{{nonUsingAreaTotal}}</div></div>
					<div class="allList">总建筑面积： <div>{{totalBuildingAreaTotal}}</div></div>
					<div class="allList">总使用面积： <div>{{totalUsingAreaTotal}}</div></div>
					<div class="allList">原值： <div>{{oldValueTotal}}</div></div>
					<div class="allList">现值： <div>{{nowValueTotal}}</div></div>
				</div>
			</div>
      <el-table max-height='500px' v-loading="listLoading" :data="list" border fit highlight-current-row size="mini">

        <el-table-column align="center" label="区房屋管理单位" prop="dname">
        </el-table-column>

        <el-table-column align="center" label="管理部(分中心)" prop="houseAdminName">
        </el-table-column>

        <el-table-column align="center" label="管片编号" prop="groupNumber">
        </el-table-column>

        <el-table-column align="center" label="管片名称" prop="blockgroup">
        </el-table-column>

        <el-table-column align="center" label="所编号" prop="blockno">
        </el-table-column>

        <el-table-column align="center" label="所地址" prop="address">
        </el-table-column>

        <el-table-column align="center" label="地级" prop="addresslevelnonliving">
        </el-table-column>

        <el-table-column align="center" label="幢号" prop="buildingno">
        </el-table-column>

        <el-table-column align="center" label="终止日期" prop="stopdate">
        </el-table-column>

        <el-table-column align="center" label="产权" prop="cqdw">
        </el-table-column>
        <el-table-column align="center" label="建筑形式" prop="buildingforms">
        </el-table-column>
        <el-table-column align="center" label="性质" prop="livingway">
        </el-table-column>
        <el-table-column align="center" label="结构" prop="structure">
        </el-table-column>
        <el-table-column align="center" label="级别" prop="structurelevel">
        </el-table-column>
        <el-table-column align="center" label="总层数" prop="floorcount">
        </el-table-column>
        <el-table-column align="center" label="总间数" prop="roomcount">
        </el-table-column>
        <el-table-column align="center" label="使用面积(住)" prop="usingarea">
        </el-table-column>
        <el-table-column align="center" label="建筑面积(住)" prop="buildingarea">
        </el-table-column>
        <el-table-column align="center" label="分摊系数(住)" prop="livingsharerate">
        </el-table-column>
        <el-table-column align="center" label="使用面积(非)" prop="nonusingarea">
        </el-table-column>
        <el-table-column align="center" label="建筑面积(非)" prop="nonbuildingarea">
        </el-table-column>
        <el-table-column align="center" label="分摊系数(非)" prop="nonlivingsharerate">
        </el-table-column>
        <el-table-column align="center" label="总建筑面积" prop="totalbuildingarea">
        </el-table-column>
        <el-table-column align="center" label="原值" prop="oldvalue">
        </el-table-column>
        <el-table-column align="center" label="现值" prop="nowvalue">
        </el-table-column>
        <el-table-column align="center" label="建造年份" prop="buildyear">
        </el-table-column>
        <el-table-column align="center" label="完好等级" prop="conditionlevel">
        </el-table-column>
        <el-table-column align="center" label="新旧程度" prop="newoldlevel">
        </el-table-column>
        <el-table-column align="center" label="折旧率" prop="formattedRate">
        </el-table-column>
        <el-table-column align="center" label="典型建筑" prop="modelbuilding">
        </el-table-column>
        <el-table-column align="center" label="变动原因" prop="changecause">
        </el-table-column>
        <el-table-column align="center" label="最后修改" prop="startcause">
        </el-table-column>
        <el-table-column align="center" label="房屋坐落区" prop="address">
        </el-table-column>
        <el-table-column align="center" label="管理形式" prop="manageway">
        </el-table-column>
        <el-table-column align="center" label="可售情况" prop="issell">
          <template slot-scope="scope">
            {{scope.row.issell==1?'是':'否'}}
          </template>
        </el-table-column>

        <el-table-column align="center" label="起始日期" prop="startdate">
          <template slot-scope="scope">
            {{scope.row.startdate?scope.row.startdate.split(' ')[0]:''}}
          </template>
        </el-table-column>

        <el-table-column align="center" label="终止日期" prop="stopdate">
          <template slot-scope="scope">
            {{scope.row.stopdate?scope.row.stopdate.split(' ')[0]:''}}
          </template>
        </el-table-column>

        <el-table-column align="center" label="产权" prop="cqdw">
        </el-table-column>

        <el-table-column align="center" label="操作" width="140" fixed="right">
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click="handleDayin(scope.row)">详情</el-button>
          </template>
        </el-table-column>
      </el-table>

      <div class="publicpaginationview">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageNum" background :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" small></el-pagination>
      </div>
		
    </div>

    <el-dialog title="详情" :visible.sync="isXiangqing" width="70%" :before-close="handleClose" style="margin-top: 100px;">
      <el-table max-height='500px' v-loading="listLoading" :data="detailQuery" border fit highlight-current-row size="mini">

        <el-table-column align="center" label="档案" prop="blockno">
        </el-table-column>

        <el-table-column align="center" label="类别" prop="ownway">
        </el-table-column>

        <el-table-column align="center" label="地点" prop="address">
        </el-table-column>

        <el-table-column align="center" label="地级(住)" prop="addresslevelliving">
        </el-table-column>

        <el-table-column align="center" label="地级(非)" prop="addresslevelnonliving">
        </el-table-column>

        <el-table-column align="center" label="幢号" prop="buildingno">
        </el-table-column>

        <el-table-column align="center" label="起始日期" prop="startdate">
          <template slot-scope="scope">
            {{scope.row.startdate?scope.row.startdate.split(' ')[0]:''}}
          </template>
        </el-table-column>

        <el-table-column align="center" label="终止日期" prop="stopdate">
          <template slot-scope="scope">
            {{scope.row.stopdate?scope.row.stopdate.split(' ')[0]:''}}
          </template>
        </el-table-column>

        <el-table-column align="center" label="产权" prop="cqdw">
        </el-table-column>
      </el-table>
      <div style="height: 40px;"></div>
    </el-dialog>
  </div>
</template>

<script>
import dayjs from 'dayjs'
import * as XLSX from 'xlsx'
import {
  blockList,
  getArea,
  getHouseAdmin,
  blockGroupList,
  dataBlockPage,
	dataBlockAll
} from '@/api/industry'
export default {
  name: 'AccommodationManagementGonglingguanli',

  data() {
    return {
      listQuery: {
        areaUnit: '',
        manageDepartment: '',
        pageNum: 1,
        pageSize: 20,
        isSell: '',
        CQDW: '',
        BlockNo: '',
        manageway: '',
        OwnWay: '',
        LivingWay: '',
        Structure: '',
        RooLivingMixmID: '',
        integer: '',
        BuildingForm: '',
        AddressLevelLiving: '',
        AddressLevelNonLiving: '',
        RAddressoomID: '',
        Modelbuilding: '',
        endPro: '',
        changecause: '',
        changedate: '',
        BuildYear: '',
        StartDate: '',
        District: '',
        AID: '',
				group:'',
					dname:''
      },
      total: 0,
      options: [
        {
          key: '1'
        }
      ],
      list: [],
      listLoading: false,
      formData: {
        userId: '',
        userName: '',
        phone: '',
        deptId: '',
        roleId: '',
        userStatus: '1',
        remarks: ''
      },
      type: '',
      value1: '',
      // 区房屋管理单位
      areaList: [],
      // 根据区获取部门
      HouseList: [],
      // 管片列表
      guanpianList: [],
      isSearch: false,
      detailQuery: [],
      isXiangqing: false,
			blockNum:'',
			buildingAreaTotal:'',
			nonBuildingAreaTotal:'',
			nonUsingAreaTotal:'',
			nowValueTotal:'',
			oldValueTotal:'',
			totalBuildingAreaTotal:'',
			totalUsingAreaTotal:'',
			usingAreaTotal:'',
				isluru:false
    }
  },

  computed: {},

  mounted() {
		if(localStorage.getItem('userHouseAdminId')>0){
			this.listQuery.areaUnit = localStorage.getItem('userDID')
			this.listQuery.dname = localStorage.getItem('userDname')
			this.listQuery.manageDepartment = localStorage.getItem('userHouseAdminName')
				this.listQuery.AID = localStorage.getItem('userHouseAdminId')
			this.isluru = true
		}
    this.getArea()
    this.blockGroupList()
    this.dataBlockPage()
  },

  methods: {
		dataBlockAll(){
      let data = {
        DID: this.listQuery.areaUnit,
        AID: this.listQuery.AID,
        manageDepartment: this.listQuery.manageDepartment,
        pageNum: this.listQuery.pageNum,
        pageSize: this.listQuery.pageSize,
        isSell: this.listQuery.isSell,
        CQDW: this.listQuery.CQDW,
        BlockNo: this.listQuery.BlockNo,
        manageway: this.listQuery.manageway,
        OwnWay: this.listQuery.OwnWay,
        LivingWay: this.listQuery.LivingWay,
        Structure: this.listQuery.Structure,
        RooLivingMixmID: this.listQuery.RooLivingMixmID,
        integer: this.listQuery.integer,
        BuildingForm: this.listQuery.BuildingForm,
        AddressLevelLiving: this.listQuery.AddressLevelLiving,
        AddressLevelNonLiving: this.listQuery.AddressLevelNonLiving,
        RAddressoomID: this.listQuery.RAddressoomID,
        Modelbuilding: this.listQuery.Modelbuilding,
        endPro: this.listQuery.endPro,
        changecause: this.listQuery.changecause,
        changedate: this.listQuery.changedate
          ? dayjs(this.listQuery.changedate).format('YYYY-MM-DD HH:mm:ss')
          : '',
        BuildYear: this.listQuery.BuildYear,
        StartDate: this.listQuery.StartDate
          ? dayjs(this.listQuery.StartDate).format('YYYY-MM-DD HH:mm:ss')
          : '',
        District: this.listQuery.District,
						group:this.listQuery.group
      }
			dataBlockAll(data).then(res=>{
				console.log(res)
				
				this.blockNum = res.data.blockNum
				this.buildingAreaTotal = res.data.buildingAreaTotal
				this.nonBuildingAreaTotal = res.data.nonBuildingAreaTotal
				this.nonUsingAreaTotal = res.data.nonUsingAreaTotal
				this.nowValueTotal = res.data.nowValueTotal
				this.oldValueTotal = res.data.oldValueTotal
				this.totalBuildingAreaTotal = res.data.totalBuildingAreaTotal
				this.totalUsingAreaTotal = res.data.totalUsingAreaTotal
				this.usingAreaTotal = res.data.usingAreaTotal
			})
		},
    handleDayin(row) {
      this.$router.push({
        path: 'suoxinxiluru',
        query: { blockid: row.blockid, type: 3, blockno: row.blockno }
      })
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then((_) => {
          done()
        })
        .catch((_) => {})
    },
    // 选择区房屋管理
    areaChange(e) {
      if (e) {
        this.listQuery.areaUnit = e
        this.getHouseAdmin(e)
      }
      this.listQuery.manageDepartment = ''
      this.listQuery.AID = ''
    },
    // 根据区获取部门
    HouseChange(e) {
      console.log(e)
      this.listQuery.manageDepartment = e.aname
      this.listQuery.AID = e.aid
    },
    // 管片列表
    blockGroupList() {
      let data = {
        group: '',
        groupNumber: '',
        houseAdmin: '',
        pageNum: '',
        pageSize: 99999
      }
      this.listLoading = true
      blockGroupList(data).then((res) => {
        this.guanpianList = res.data.list
        this.listLoading = false
        // this.houseAdminList()
      })
    },
    blockList() {
      let data = {
        address: this.listQuery.address,
        areaUnit: this.listQuery.areaUnit,
        blockNo: this.listQuery.blockNo,
        endProduct: this.listQuery.endProduct,
        manageDepartment: this.listQuery.manageDepartment,
        limit: this.listQuery.pageSize,
        page: this.listQuery.pageNum
      }
      this.listLoading = true
      blockList(data).then((res) => {
        this.list = res.data.list
        console.log(this.list)
        this.listLoading = false
      })
    },
		groupChange(e){
			console.log(e)
			this.listQuery.group = e.groupno
			this.listQuery.BlockNo = e.groupnew
		},
    getArea() {
      getArea().then((res) => {
        console.log(res)
        this.areaList = res.data
      })
    },
    getHouseAdmin(e) {
      getHouseAdmin({
        DID: e
      }).then((res) => {
        this.HouseList = res.data
      })
    },
    handleSizeChange(val) {
      this.listQuery.pageNum = 1
      this.listQuery.pageSize = val
      this.blockList()
    },
    handleCurrentChange(val) {
      this.listQuery.pageNum = val
      this.blockList()
    },

    resetForm(val) {
      console.log('1')
      this.$refs[val].resetFields()
			if(this.isluru == true){
				this.listQuery.areaUnit = localStorage.getItem('userDID')
				this.listQuery.dname = localStorage.getItem('userDname')
				this.listQuery.manageDepartment = localStorage.getItem('userHouseAdminName')
					this.listQuery.AID = localStorage.getItem('userHouseAdminId')
			}
    },

    handleAddUser() {
      this.$router.push('chanquanziliaoluru')
    },
    handleUpdate() {
      this.$confirm('此操作将导出该条内容，请确认是否继续操作？', '导出提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          let data = {
            DID: this.listQuery.areaUnit,
            manageDepartment: this.listQuery.manageDepartment,
            pageNum: this.listQuery.pageNum,
            pageSize: 999999,
            isSell: this.listQuery.isSell,
            CQDW: this.listQuery.CQDW,
            BlockNo: this.listQuery.BlockNo,
            manageway: this.listQuery.manageway,
            OwnWay: this.listQuery.OwnWay,
            LivingWay: this.listQuery.LivingWay,
            Structure: this.listQuery.Structure,
            RooLivingMixmID: this.listQuery.RooLivingMixmID,
            integer: this.listQuery.integer,
            BuildingForm: this.listQuery.BuildingForm,
            AddressLevelLiving: this.listQuery.AddressLevelLiving,
            AddressLevelNonLiving: this.listQuery.AddressLevelNonLiving,
            RAddressoomID: this.listQuery.RAddressoomID,
            Modelbuilding: this.listQuery.Modelbuilding,
            endPro: this.listQuery.endPro,
            changecause: this.listQuery.changecause,
            changedate: this.listQuery.changedate
              ? dayjs(this.listQuery.changedate).format('YYYY-MM-DD HH:mm:ss')
              : '',
            BuildYear: this.listQuery.BuildYear,
            StartDate: this.listQuery.StartDate
              ? dayjs(this.listQuery.StartDate).format('YYYY-MM-DD HH:mm:ss')
              : '',
            District: this.listQuery.District,
						group:this.listQuery.group
          }
          dataBlockPage(data).then((res) => {
            let list = res.data.list
            let outList = []
            res.data.list.forEach((item, index) => {
              outList.push({
                档案: item.blockno,
                类别: item.ownway,
                地点: item.address,
                '地级(住)': item.addresslevelliving,
                '地级(非)': item.addresslevelnonliving,
                幢号: item.buildingno,
                起始日期: item.startdate,
                终止日期: item.stopdate,
                产权: item.cqdw
              })
            })
            // 获取表格数据
            const data = outList
            // 转换数据为工作表
            const worksheet = XLSX.utils.json_to_sheet(data)
            // 创建新的工作簿
            const workbook = XLSX.utils.book_new()
            // 将工作表添加到工作簿
            XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
            // 导出Excel文件
            XLSX.writeFile(workbook, '所信息.xlsx')
          })
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消导出'
          })
        })
    },
    // 查询
    sumbitCx() {
			console.log(this.listQuery)
      this.dataBlockPage()
    },
    dataBlockPage() {
      let data = {
        DID: this.listQuery.areaUnit,
        AID: this.listQuery.AID,
        manageDepartment: this.listQuery.manageDepartment,
        pageNum: this.listQuery.pageNum,
        pageSize: this.listQuery.pageSize,
        isSell: this.listQuery.isSell,
        CQDW: this.listQuery.CQDW,
        BlockNo: this.listQuery.BlockNo,
        manageway: this.listQuery.manageway,
        OwnWay: this.listQuery.OwnWay,
        LivingWay: this.listQuery.LivingWay,
        Structure: this.listQuery.Structure,
        RooLivingMixmID: this.listQuery.RooLivingMixmID,
        integer: this.listQuery.integer,
        BuildingForm: this.listQuery.BuildingForm,
        AddressLevelLiving: this.listQuery.AddressLevelLiving,
        AddressLevelNonLiving: this.listQuery.AddressLevelNonLiving,
        RAddressoomID: this.listQuery.RAddressoomID,
        Modelbuilding: this.listQuery.Modelbuilding,
        endPro: this.listQuery.endPro,
        changecause: this.listQuery.changecause,
        changedate: this.listQuery.changedate
          ? dayjs(this.listQuery.changedate).format('YYYY-MM-DD HH:mm:ss')
          : '',
        BuildYear: this.listQuery.BuildYear,
        StartDate: this.listQuery.StartDate
          ? dayjs(this.listQuery.StartDate).format('YYYY-MM-DD HH:mm:ss')
          : '',
        District: this.listQuery.District,
						group:this.listQuery.group
      }
      this.listLoading = true
      dataBlockPage(data).then((res) => {
        console.log(res)
        this.list = res.data.list
        this.total = res.data.total
        this.listLoading = false
		this.dataBlockAll()
				
      })
    }
  }
}
</script>
<style scoped>
.saveContent {
  width: 100%;
  display: flex;
  justify-content: end;
  margin-top: 20px;
  padding-bottom: 20px;
}

.title {
  color: #008c93;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

.cfguanpian {
  padding-bottom: 20px;
  color: #008c93;
  margin-bottom: 20px;
  font-weight: bold;
}

.title2 {
  color: #008c93;
  margin-bottom: 20px;
  font-weight: bold;
}

.tianjiaButton {
  border: 2px solid #008c93;
  background-color: #fff;
  color: #008c93;
}

.el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 150px;
}
/deep/.el-input__inner {
  width: 130px;
}
/deep/.publicpaginationview .el-input__inner {
  width: 100px;
}
/deep/.publicpaginationview .is-in-pagination .el-input__inner {
  width: 50px;
}
 
 .allList{
	 min-width: 120px;
	 height: 40px;
	 box-sizing: border-box;
	 border: 1px solid black;
	 text-align: center;
 }
 .headContent{
	 display: flex;
	 align-items:center
 }
 .allNum{
	 display: flex;
	 margin-left:20px
 }
</style>